package cn.exrick.xboot.modules.assessment.service;

import cn.exrick.xboot.base.XbootBaseService;
import cn.exrick.xboot.common.vo.Result;
import cn.exrick.xboot.modules.assessment.entity.HkAssessmentIndex;
import cn.exrick.xboot.modules.assessment.vo.HkAssessmentIndexVo;
import cn.exrick.xboot.modules.assessment.vo.HkAssessmentInfoVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import cn.exrick.xboot.common.vo.SearchVo;

import java.util.List;

/**
 * 考核指标接口
 * @author yck
 */
public interface HkAssessmentIndexService extends XbootBaseService<HkAssessmentIndex, String> {

    /**
    * 多条件分页获取
    * @param hkAssessmentIndex
    * @param searchVo
    * @param pageable
    * @return
    */
    Page<HkAssessmentIndex> findByCondition(HkAssessmentIndex hkAssessmentIndex, SearchVo searchVo, Pageable pageable);

    /**
     * 新增指标项
     * @param hkAssessmentIndex
     * @return
     */
    Result<Object> saveHkAssessmentIndex(HkAssessmentIndex hkAssessmentIndex);
    /**
     * 修改指标项
     * @param hkAssessmentIndex
     * @return
     */
    Result<Object> updateHkAssessmentIndex(HkAssessmentIndex hkAssessmentIndex);

    /**
     * 根据表单和指标类型查询指标项
     * @param formEntityId
     * @param indexId
     * @return
     */
    List<HkAssessmentInfoVo> findByFormEntityIdAndIndexType(String formEntityId, Integer indexId);

    /**
     * 自定义批量插入
     * @param hkAssessmentIndices
     * @return
     */
    int batchInsert(List<HkAssessmentIndexVo> hkAssessmentIndices);

    /**
     * 根据名称查询
     * @param indexName
     * @return
     */
    HkAssessmentIndex findByIndexName(String indexName);
}